package org.op.looks;

import java.awt.Font;

import javax.swing.JFrame;

import com.l2fprod.common.swing.JFontChooser;

public class SetFontPopupViewImpl implements SetFontPopupView {
	
	private JFrame parentFrame;
	private String fontFamily;
	private String fontSize;
	
	public String getFontFamily() {
		return fontFamily;
	}

	public boolean showAndGet() {
		JFontChooser fontChooser = new JFontChooser();
		//fontChooser.setVisible(true);
		Font font = fontChooser.showFontDialog(parentFrame, "Choose Font..");
		
		boolean save = false;
		if (font!=null) {
			fontFamily = font.getFamily();
			fontSize = (new Integer(font.getSize())).toString();
			save = true;
		}
		
		System.out.println("Font family = " + fontFamily + "; size = " + fontSize);
		return save;
	}

	public String getFontSize() {
		return fontSize;
	}

	public void setFrame(JFrame parent) {
		// TODO Auto-generated method stub
		parentFrame = parent;
	}

}
